﻿CREATE PROCEDURE [dbo].[SavePngFile]
	@WorkflowGuid VARCHAR(50),
	@Version VARCHAR(10),
	@Author VARCHAR(100),
	@UpdatedOn DATETIME,
	@PngFile IMAGE 
AS
	IF NOT EXISTS (SELECT * FROM PngFiles WHERE WorkflowGuid=@WorkflowGuid AND Version=@Version)
	BEGIN
		INSERT INTO PngFiles (
			WorkflowGuid,
			Version,
			Author,
			UpdatedOn,
			PngFile) VALUES (
			@WorkflowGuid,
			@Version,
			@Author,
			@UpdatedOn,
			@PngFile)
	END
RETURN 0;